package com.cs.common.init;

import java.util.HashMap;

import com.cs.common.init.beans.SAPFileBean;

/**
 * SAP File Names collection
 * @version 1.0 
 * @date  2010-03-11
 * @author jdelgado
 */

public class SAPFileBeanCollection extends HashMap implements IInit {
	/** Serialization UID */
	private static final long serialVersionUID = -2973623598642866417L;
	/** Class instance */
	private static SAPFileBeanCollection sapFileBeanCollection = null;
	/**
	 * Gets class instance filled
	 */
	public static SAPFileBeanCollection getInstance(){
		return sapFileBeanCollection;
	}
	/**
	 * Loads the xml file into class
	 * @param object Object to load
	 */
	public void init(Object object) {
		if( object != null ){
			if( object instanceof SAPFileBeanCollection){
				sapFileBeanCollection = (SAPFileBeanCollection) object;
			}
		}
	}
	/**
	 * Add PhonesTypeBean to the collection
	 * @param phonesTypeBean
	 */			
	public void addSAPFileBean( SAPFileBean sapFileBean){
		this.put(sapFileBean.getClassName(), sapFileBean);
	}
	/**
	 * Gets parameter bean
	 * @param code Parameter code
	 * @return SystemParameterBean
	 */
	public SAPFileBean getSAPComponentFileBean(String className){
		SAPFileBean sapComponentFileBean = null;
		sapComponentFileBean = (SAPFileBean)this.get(className);
		return sapComponentFileBean;
	}
}